Back to Main Menu

Create Functional Location

Introduction

The Assetic REST API endpoints allow per record creation of Functional Location via:

  • POST /api/v2/functionallocation

 

Please read the article Asset Integration Overview if unclear how this endpoint relates to the asset structure in Assetic.

 

This API endpoint is real-time in that the functional location is created immediately and returns key identifiers such as the Assetic unique system Functional Location GUID and the user visible friendly Functional Location ID if ID autogeneration is enabled. This allows the external application to record the Assetic ID's for the newly created records.

 

There is rate limit applied to the Assetic REST API's which should be considered when attempting to create a large number of records.

 

The process described in Data-Exchange-Integration should be used for data migration projects or large volume transactions.

POST /api/v2/functionallocation

Functional Location Fields

Introduction

The API POST /api/v2/functionallocation creates the Functional Location, which is comprised of the core fields applied to all functional location definitions, and a set of additional attribute fields.  The list of attribute fields is dependent on the Functional Location Type.  Note that some of these non-core attribute fields may be common to all Functional Location Types.

Core Fields

The core fields for Functional Location are listed in the article Asset Integration Overview.

 

When creating a functional location observe the following rules:

  • If not using auto-id generation, "FunctionalLocationId" is mandatory and must be unique across all functional locations regardless of the Functional Location Type
  • If using auto-id generation the FunctionLocationId will be ignored in the request but returned in the response.
  • "FunctionalLocationName" is not unique, it can be duplicated
  • "FunctionalLocationTypeId" is mandatory
  • "FunctionalLocationType" will be ignored in the request but returned in the response.

Attribute Fields

The non-core Functional Location attribute fields are included in the request as an object containing key-value pairs where attribute name is the key.

Functional Location Type

When creating the Functional Location it is necessary to specify the Functional Location Type via it's unique GUID identifier.  The API GET /api/v2/functionallocationtypes is used to get the GUID identifiers.

 

The example below gets the Functional Location Type record for the given Functional Location Type name of "Road". 

Sample Payload

https://[your_site].assetic.net/api/v2/functionallocationtypes?requestParams.filters=FunctionalLocationTypeName~eq~'Road'

From the response the "Id" is the GUID of the Functional Location Type, as shown below:

Sample Response

{   "TotalResults": 1,   "TotalPages": 1,   "Page": 1,   "ResourceList": [     {       "Id": "aab4526b-e2b3-4979-8b4b-c839a7f4b685",       "FunctionalLocationTypeName": "Road",       "_links": [],       "_embedded": null     }   ],   "_links": [],   "_embedded": null }

Example: Create Functional Location

Sample Payload

The following sample creates a new Functional Location where auto_id generation is False.

 

Two attributes are also defined, "Zone" and "General Comments"

{
"FunctionalLocationId": "ABBFL2",
"FunctionalLocationName": "Name 1",
"FunctionalLocationTypeId": "aab4526b-e2b3-4979-8b4b-c839a7f4b685",
"Attributes":
{
"GroupAssetZone":"Zone 1",
"GroupAssetComment":"This is an example comment"
}
}